<?php

namespace app\web\controller;
use app\common\controller\StoreBaseController;
use think\Db;
/**
 * 访问量统计
 */
class VisitEnterController extends StoreBaseController
{

	
    protected function _initialize() {
        parent::_initialize();

    }
    /**
     * 访问量统计
     * @author [lx] 
     */
    public function index( $page = 1){
    	$agent_id = session('storeInfo')['id'];
		$now = date('Y-m-d');
		$befor=date('Y-m-d',strtotime('-7 day'));
		
		//今日销量统计
		$today = Db::name("mall_pv")->where('pid',$agent_id)->whereTime('addtime','between',[$befor,$now])->group('addtime','DESC')->select();

        return $this->fetch('index',['list' => $today]);
    }


   
}